package com.idheima.zuoye.zuoye4;

import java.util.ArrayList;

public class Test {
    public static void main(String[] args) {
    ArrayList<Student> list = new ArrayList<>();
        Student s = new Student("艾大海", "A230602820", "男", 25, "大专以下", "永州职业技术学员");
        Student s2 = new Student("曹少坤", "A230601537", "男", 23, "本科及以上", "");
        Student s3 = new Student("陈橙", "A230600767", "男", 21, "大专 ", "湖南软件职业学员");
        Student s4 = new Student("陈福", "A230601913", "男", 21, "大专", "湖南机电职业技术学员");
        Student s5 = new Student("陈美鹃", "A230600523", "男", 25, "本科及以上", "");
        Student s6 = new Student("陈鑫", "A230601837", "男", 21, "大专以下", "长查民政职业技术学员");
        Student s7 = new Student("陈泳名", "A230601852", "男", 23, "大专", "湖南信息职业技术学员");
        Student s8 = new Student("邓灿宇", "A230601109", "男", 22, "大专", "");
        Student s9 = new Student("邓明", "A230601830", "男", 21, "大专以下", "");
        Student s10 = new Student("付云杰", "A230603250", "男", 22, "大专", "湘西名族职业技术学员");
        Student s11 = new Student("胡振宇", "A230601217", "男", 25, "本科及以上", "湖南涉外经济学员");
        Student s12 = new Student("黄永麒", "A210302017", "男", 23, "本科及以上", "湖南涉外经济学员");
    list.add(s);
    list.add(s2);
    list.add(s3);
    list.add(s4);
    list.add(s5);
    list.add(s6);
    list.add(s7);
    list.add(s8);
    list.add(s9);
    list.add(s10);
    list.add(s11);
    list.add(s12);
        for (Student student : list) {

        }

        String url = "https://tlias.itcast.cn/tz/classStudentList?name=邓&age=21";

        String  result = url.substring(url.length()-8, url.length()-7);
        String age = url.substring(url.length()-2);
        int age1 = Integer.parseInt(age);
        for (int i = 0; i < list.size(); i++) {
            if (list.get(i).getName().startsWith(result) && list.get(i).getAge()== age1){
                System.out.println("找到该学生");


                System.out.println(list.get(i).getName()+list.get(i).getAge()+list.get(i).getBackground()+list.get(i).getSchool());
            }

        }



    }


}
